package com.kuqi.dao;

import com.kuqi.entity.VideoInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface VideoRepository extends JpaRepository<VideoInfo, Integer> {

    // 查询用于展示的数据，这里限制查询四个
    @Query(value = "select * from video where  type =  ?1 and is_child = ?2 limit 4",nativeQuery = true)
    List<VideoInfo> findByTypeAndChild(int type, int isChild);

}